package com.ims.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ims.util.PageResult;
import com.ims.util.QueryPageBean;
import com.ims.util.Result;
import com.ims.pojo.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface UserService extends IService<User> {

    /**
     * 新增管理员用户
     * @param user
     * @return
     */
    Result<Integer> add(User user);

    /**
     * 用户登录
     * @param username
     * @param password
     * @return
     */
    Result login(String username, String password, HttpServletRequest request, HttpServletResponse response);

    /**
     * 查询所有用户
     * @return
     */
    Result<List<User>> findAll();

    /**
     * 分页查询
     * @param queryPageBean
     * @return
     */
    PageResult<User> findPage(QueryPageBean queryPageBean);

    /**
     * 退出登录
     * @param userId
     * @return
     */
    Result logout(Integer userId);

    /**
     * 删除用户
     * @param userId
     * @return
     */
    Result deleteById(Integer userId);

    /**
     * 更新用户
     * @param user
     * @return
     */
    Result updateUser(User user);
}
